package vip.web3.api.dao.biz;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import vip.web3.api.entity.biz.OrderEntity;
import vip.web3.api.vo.biz.OrderRecordVo;

import java.math.BigDecimal;
import java.util.List;

/**
 * 订单Mapper接口
 * <p>
 * aut-horlilei
 *
 * @date 2024-09-27
 */
@Mapper
public interface OrderDao extends BaseMapper<OrderEntity> {


    OrderEntity totalTeamInvest(Integer userId);

    List<OrderRecordVo> buyRecords(Integer userId);

    int insertBatchWhenBuy(List<OrderEntity> orders);

    @Select("select count(*) from a_order where pro_id != 1 and create_date > #{start} and create_date < #{end}")
    int countOrder(@Param("start") String start, @Param("end") String end);

    @Select("select sum(amount_cny)  from a_order where pro_id != 1")
    public Double orderSum();
}
